<h1 translate="audit.title"></h1>

<div class="audit">
	<form name="auditFitler" class="form-horizontal">
		<div class="panel panel-default">
			<div class="panel-heading" translate="panel.search"></div>
			<div class="panel-body">
				<date-preset criteria="criteria" date-changed="reloadAudit()"></date-preset>
			</div>
			<div class="panel-footer text-right">
<!--				<button type="button" class="btn btn-danger"ng-click="export()">
					{{'button.export'| translate}}
					<span class="glyphicon glyphicon-export"></span>
				</button>-->
				<button type="submit" class="btn btn-primary" 
						ng-disabled="auditFitler.$invalid"
						ng-click="reloadAudit()">
					{{'button.search'| translate}} 
					<span class="glyphicon glyphicon-search"> </span>
				</button>
			</div>
		</div>
	</form>
	
	<div class="alert alert-warning"
		 ng-show="history.length>=criteria.limit"
		 translate="audit.alertLimit" translate-values="criteria">
	</div>

	<table class="table">
		<thead>
			<tr>
				<th style="width:130px" translate="general.date"></th>
				<th style="width:100px" translate="audit.object"></th>
				<th style="width:100px" translate="audit.action"></th>
				<th style="min-width:150px"translate="general.user"></th>
				<th translate="audit.content"></th>
			</tr>
		</thead>
		<tbody>
			<tr ng-repeat="h in history"
				ng-class="h.object|lowercase">
				<td>{{h.when|formatTimestamp:'DD.MM.YYYY HH:mm'}}</td>
				<td>{{h.object}}</td>
				<td>{{h.action}}</td>
				<td>{{h.who|prettyUser}}</td>
				<td>{{h.content}}</td>
			</tr>
		</tbody>
	</table>
</div>